clearclear matrixlog using "oil_hr.log", replace*************************************************************************************************************************************************** File to run models and calculate quantities of interest for the paper ************* "A Political Economy of Human Rights:  *********************
****************** Oil and State Incentives to Repress" *****************                                                                *************************************************************************
* Paper authors: DeMeritt & Young* Created by: Jacqueline H.R. DeMeritt 									** Created on: 7 August 2010   											*                                               	                * Last edited on: 6 March 2012                                      	*	
* Last edited by: JHRD													*                 **************************************************************************************************************************************************

set mem 1000m
set matsize 1000use "oil_hr.dta"
set seed 11232007
set more off

* NOTE: CIRI physint and all component parts are flipped so that higher 
* values indicate *decreasing* govt respect for rights, or increasing abuse.

* Oil is FL's dummy for oil exporters
* oil_gas_rentPOP is Ross's oil measure
* ln_oil_gas_rentPOP is the natural log of that measure +.001.

***************************
***************************
* DV = CIRI Physint Index *
***************************
***************************

*************************
* run model with oil = Fearon & Laitin oil dummy
*************************
ologit physintflip Oil polity2 gdpenl jobinsecurity_bdm lpop diss_lag cowwarl lmtnest physint_lag, nolog cluster(ccode)

*add interaction (robustness check)
ologit physintflip Oil polity2 gdpenl demxgdp jobinsecurity_bdm lpop diss_lag cowwarl lmtnest physint_lag, nolog cluster(ccode)

*************************
* run model with oil = Ross oil & fuel rents per capita
*************************
ologit physintflip oil_gas_rentPOP polity2 gdpenl jobinsecurity_bdm lpop diss_lag cowwarl lmtnest physint_lag, nolog cluster(ccode)

*add interaction (robustness check)
ologit physintflip oil_gas_rentPOP polity2 gdpenl demxgdp jobinsecurity_bdm lpop diss_lag cowwarl lmtnest physint_lag, nolog cluster(ccode)

*************************
* run model with oil = ln(Ross oil & fuel rents per capita)
*************************
ologit physintflip ln_oil_gas_rentPOP polity2 gdpenl jobinsecurity_bdm lpop diss_lag cowwarl lmtnest physint_lag, nolog cluster(ccode)

*add interaction (robustness check)
ologit physintflip ln_oil_gas_rentPOP polity2 gdpenl demxgdp jobinsecurity_bdm lpop diss_lag cowwarl lmtnest physint_lag, nolog cluster(ccode)

*****************
*****************
* DV = PTS (AI) *
*****************
*****************

*************************
* run model with oil = Fearon & Laitin oil dummy
*************************
ologit pts_a Oil polity2 gdpenl jobinsecurity_bdm lpop diss_lag cowwarl lmtnest repression_lag, nolog cluster(ccode)

*add interaction (robustness check)
ologit pts_a Oil polity2 gdpenl demxgdp jobinsecurity_bdm lpop diss_lag cowwarl lmtnest repression_lag, nolog cluster(ccode)


*************************
* run model with oil = Ross oil & fuel rents per capita
*************************
ologit pts_a oil_gas_rentPOP polity2 gdpenl jobinsecurity_bdm lpop diss_lag cowwarl lmtnest repression_lag, nolog cluster(ccode)

*add interaction (robustness check)
ologit pts_a oil_gas_rentPOP polity2 gdpenl demxgdp jobinsecurity_bdm lpop diss_lag cowwarl lmtnest repression_lag, nolog cluster(ccode)


*************************
* run model with oil = ln(Ross oil & fuel rents per capita)
*************************
ologit pts_a ln_oil_gas_rentPOP polity2 gdpenl jobinsecurity_bdm lpop diss_lag cowwarl lmtnest repression_lag, nolog cluster(ccode)

*add interaction (robustness check)
ologit pts_a ln_oil_gas_rentPOP polity2 gdpenl demxgdp jobinsecurity_bdm lpop diss_lag cowwarl lmtnest repression_lag, nolog cluster(ccode)

******************
******************
* DV = PTS (DoS) *
******************
******************

*************************
* run model with oil = Fearon & Laitin oil dummy
*************************
ologit pts_s Oil polity2 gdpenl jobinsecurity_bdm lpop diss_lag cowwarl lmtnest repression_lag2, nolog cluster(ccode)

*add interaction (robustness check)
ologit pts_s Oil polity2 gdpenl demxgdp jobinsecurity_bdm lpop diss_lag cowwarl lmtnest repression_lag2, nolog cluster(ccode)


*************************
* run model with oil = Ross oil & fuel rents per capita
*************************
ologit pts_s oil_gas_rentPOP polity2 gdpenl jobinsecurity_bdm lpop diss_lag cowwarl lmtnest repression_lag2, nolog cluster(ccode)

*add interaction (robustness check)
ologit pts_s oil_gas_rentPOP polity2 gdpenl demxgdp jobinsecurity_bdm lpop diss_lag cowwarl lmtnest repression_lag2, nolog cluster(ccode)


*************************
* run model with oil = ln(Ross oil & fuel rents per capita)
*************************
ologit pts_s ln_oil_gas_rentPOP polity2 gdpenl jobinsecurity_bdm lpop diss_lag cowwarl lmtnest repression_lag2, nolog cluster(ccode)

*add interaction (robustness check)
ologit pts_s ln_oil_gas_rentPOP polity2 gdpenl demxgdp jobinsecurity_bdm lpop diss_lag cowwarl lmtnest repression_lag2, nolog cluster(ccode)

log close
log using "oil_hr_substantive.log", replace

***********************
***********************
* SUBSTANTIVE EFFECTS *
***********************
***********************
quietly{
*drop b*
estsimp ologit physintflip Oil polity2 gdpenl jobinsecurity_bdm lpop diss_lag cowwarl lmtnest physint_lag, nolog cluster(ccode)
setx polity2 3 gdpenl mean jobinsecurity_bdm mean lpop mean diss_lag mean cowwarl 0 lmtnest mean physint_lag 5 
}
** EFFECTS OF BECOMING AN OIL EXPORTER (FL Oil 0->1), all else equal (at means and medians):
simqi, fd(pr) changex(Oil 0 1)

quietly{
drop b*
estsimp ologit physintflip oil_gas_rentPOP polity2 gdpenl jobinsecurity_bdm lpop diss_lag cowwarl lmtnest physint_lag, nolog cluster(ccode)
setx polity2 3 gdpenl mean jobinsecurity_bdm mean lpop mean diss_lag mean cowwarl 0 lmtnest mean physint_lag 5 
}
** BASELINE PR (all vars at means or modes):
setx oil_gas_rentPOP 320.3041 
simqi

** EFFECTS OF A MIN-MAX INCREASE IN OIL INCOME PER CAPITA (Ross's oil measure):
simqi, fd(pr) changex(oil_gas_rentPOP min max)

** EFFECTS OF INCREASED OIL/CAPITA +1sd above mean:
simqi, fd(pr) changex(oil_gas_rentPOP 320.3041 320.3031+1336.275)

** EFFECTS OF INCREASED OIL/CAPITA +2sd above mean:
simqi, fd(pr) changex(oil_gas_rentPOP 320.3041 320.3031+1336.275+1336.275)

** EFFECTS OF INCREASED OIL/CAPITA +3sd above mean:
simqi, fd(pr) changex(oil_gas_rentPOP 320.3041 4329.1281)

** EFFECTS OF INCREASED OIL/CAPITA +5sd above mean:
simqi, fd(pr) changex(oil_gas_rentPOP 320.3041 7001.6781)

log close
log using "oil_hr_supplement.log", replace

********************************
********************************
* INFORMATION FOR ONLINE SUPPLEMENT
********************************
********************************
set seed 11232007

*** Distributions on DVs ***

hist physintflip, discrete scheme(sj) xtitle("CIRI Physical Integrity Index (flipped)")
graph export hist_ciri.pdf, replace

hist pts_a, discrete scheme(sj) xtitle("Political Terror Scale (AI)")
graph export hist_ptsa.pdf, replace

hist pts_s, discrete scheme(sj) xtitle("Political Terror Scale (DOS)")
graph export hist_ptss.pdf, replace

*** Models via OLS ***

* CIRI
reg physintflip Oil polity2 gdpenl jobinsecurity_bdm lpop diss_lag cowwarl lmtnest physint_lag, cluster(ccode)
reg physintflip oil_gas_rentPOP polity2 gdpenl jobinsecurity_bdm lpop diss_lag cowwarl lmtnest physint_lag, cluster(ccode)

* PTS_A
reg pts_a Oil polity2 gdpenl jobinsecurity_bdm lpop diss_lag cowwarl lmtnest repression_lag, cluster(ccode)
reg pts_a oil_gas_rentPOP polity2 gdpenl jobinsecurity_bdm lpop diss_lag cowwarl lmtnest repression_lag, cluster(ccode)

* PTS_S
reg pts_s Oil polity2 gdpenl jobinsecurity_bdm lpop diss_lag cowwarl lmtnest repression_lag2, cluster(ccode)
reg pts_s oil_gas_rentPOP polity2 gdpenl jobinsecurity_bdm lpop diss_lag cowwarl lmtnest repression_lag2, cluster(ccode)

*** CIRI Component Rights (ologit) ***

* Disappearances
ologit disappear Oil polity2 gdpenl jobinsecurity_bdm lpop diss_lag cowwarl lmtnest disappear_lag, cluster(ccode) nolog
ologit disappear oil_gas_rentPOP polity2 gdpenl jobinsecurity_bdm lpop diss_lag cowwarl lmtnest disappear_lag, cluster(ccode) nolog

* Killing
ologit kill Oil polity2 gdpenl jobinsecurity_bdm lpop diss_lag cowwarl lmtnest kill_lag, cluster(ccode) nolog
ologit kill oil_gas_rentPOP polity2 gdpenl jobinsecurity_bdm lpop diss_lag cowwarl lmtnest kill_lag, cluster(ccode) nolog

* Imprisonment
ologit imprison Oil polity2 gdpenl jobinsecurity_bdm lpop diss_lag cowwarl lmtnest imprison_lag, cluster(ccode) nolog
ologit imprison oil_gas_rentPOP polity2 gdpenl jobinsecurity_bdm lpop diss_lag cowwarl lmtnest imprison_lag, cluster(ccode) nolog

* Torture
ologit torture Oil polity2 gdpenl jobinsecurity_bdm lpop diss_lag cowwarl lmtnest torture_lag, cluster(ccode) nolog
ologit torture oil_gas_rentPOP polity2 gdpenl jobinsecurity_bdm lpop diss_lag cowwarl lmtnest torture_lag, cluster(ccode) nolog

********************************
* RECONCEPTUALIZE DEMOCRACY
********************************

*** Binary decomposition of POLITY Democ-Autoc ***
xi: ologit physintflip Oil gdpenl jobinsecurity_bdm lpop diss_lag cowwarl lmtnest physint_lag i.polity2, cluster(ccode)
xi: ologit physintflip oil_gas_rentPOP gdpenl jobinsecurity_bdm lpop diss_lag cowwarl lmtnest physint_lag i.polity2, cluster(ccode)
xi: ologit pts_a Oil gdpenl jobinsecurity_bdm lpop diss_lag cowwarl lmtnest repression_lag i.polity2, cluster(ccode)
xi: ologit pts_a oil_gas_rentPOP gdpenl jobinsecurity_bdm lpop diss_lag cowwarl lmtnest repression_lag i.polity2, cluster(ccode)
xi: ologit pts_s Oil gdpenl jobinsecurity_bdm lpop diss_lag cowwarl lmtnest repression_lag2 i.polity2, cluster(ccode)
xi: ologit pts_s oil_gas_rentPOP gdpenl jobinsecurity_bdm lpop diss_lag cowwarl lmtnest repression_lag2 i.polity2, cluster(ccode)

*** Collapsed (linear) scale of POLITY Democ-Autoc ***
*NOTE: Each linear scale is derived from the coefficients on the corresponding binary decomposition (above). 
quietly{
gen polity_linear1=.
replace polity_linear1=1 if polity2<-7
replace polity_linear1=2 if polity2==-7
replace polity_linear1=3 if polity2>-7 & polity2<-4
replace polity_linear1=4 if polity2>-5 & polity2<-1
replace polity_linear1=5 if polity2>-2 & polity2<1
replace polity_linear1=6 if polity2>0 & polity2<3
replace polity_linear1=7 if polity2==3
replace polity_linear1=8 if polity2==4
replace polity_linear1=9 if polity2==5
replace polity_linear1=10 if polity2>5
tab polity_linear1
}

quietly{
gen polity_linear2=.
replace polity_linear2=1 if polity2<-8
replace polity_linear2=2 if polity2>-9 & polity2<-6
replace polity_linear2=3 if polity2==-6
replace polity_linear2=4 if polity2>-6 & polity2<0
replace polity_linear2=5 if polity2==0
replace polity_linear2=6 if polity2>0 & polity2<3
replace polity_linear2=7 if polity2==3
replace polity_linear2=8 if polity2>3
tab polity_linear2
}

quietly{
gen polity_linear3=.
replace polity_linear3=1 if polity2<0
replace polity_linear3=2 if polity2==0
replace polity_linear3=3 if polity2>0 & polity2<3
replace polity_linear3=4 if polity2==3
replace polity_linear3=5 if polity2>3
tab polity_linear3
}

quietly{
gen polity_linear4=.
replace polity_linear4=1 if polity2<0
replace polity_linear4=2 if polity2==0
replace polity_linear4=3 if polity2>0 & polity2<3
replace polity_linear4=4 if polity2==3
replace polity_linear4=5 if polity2>3
tab polity_linear4
}

quietly{
gen polity_linear5=.
replace polity_linear5=1 if polity2<-5
replace polity_linear5=2 if polity2==-5
replace polity_linear5=3 if polity2>-5 & polity2<0
replace polity_linear5=4 if polity2==0
replace polity_linear5=5 if polity2>0 & polity2<3
replace polity_linear5=6 if polity2==3
replace polity_linear5=7 if polity2>3
tab polity_linear5
} 

quietly{
gen polity_linear6=.
replace polity_linear6=1 if polity2<-5
replace polity_linear6=2 if polity2==-5
replace polity_linear6=3 if polity2>-5 & polity2<0
replace polity_linear6=4 if polity2==0
replace polity_linear6=5 if polity2>0 & polity2<3
replace polity_linear6=6 if polity2==3
replace polity_linear6=7 if polity2>3
tab polity_linear6
}


ologit physintflip Oil polity_linear1 gdpenl jobinsecurity_bdm lpop diss_lag cowwarl lmtnest physint_lag, cluster(ccode)
ologit physintflip oil_gas_rentPOP polity_linear2 gdpenl jobinsecurity_bdm lpop diss_lag cowwarl lmtnest physint_lag, cluster(ccode)
ologit pts_a Oil polity_linear3 gdpenl jobinsecurity_bdm lpop diss_lag cowwarl lmtnest repression_lag, cluster(ccode)
ologit pts_a oil_gas_rentPOP polity_linear4 gdpenl jobinsecurity_bdm lpop diss_lag cowwarl lmtnest repression_lag, cluster(ccode)
ologit pts_s Oil polity_linear5 gdpenl jobinsecurity_bdm lpop diss_lag cowwarl lmtnest repression_lag2, cluster(ccode)
ologit pts_s oil_gas_rentPOP polity_linear6 gdpenl jobinsecurity_bdm lpop diss_lag cowwarl lmtnest repression_lag2, cluster(ccode)

********************************
* OTHER ROBUSTNESS CHECKS
********************************

*** Control for MidEast States = oil produces, repressors ***

* Control via North Africa/MidEast Dummy:
ologit physintflip Oil polity2 gdpenl jobinsecurity_bdm lpop diss_lag cowwarl lmtnest physint_lag nafrme, nolog robust
ologit physintflip oil_gas_rentPOP polity2 gdpenl jobinsecurity_bdm lpop diss_lag cowwarl lmtnest physint_lag nafrme, nolog robust
ologit pts_a Oil polity2 gdpenl jobinsecurity_bdm lpop diss_lag cowwarl lmtnest repression_lag nafrme, nolog robust
ologit pts_a oil_gas_rentPOP polity2 gdpenl jobinsecurity_bdm lpop diss_lag cowwarl lmtnest repression_lag nafrme, nolog robust
ologit pts_s Oil polity2 gdpenl jobinsecurity_bdm lpop diss_lag cowwarl lmtnest repression_lag2 nafrme, nolog robust
ologit pts_s oil_gas_rentPOP polity2 gdpenl jobinsecurity_bdm lpop diss_lag cowwarl lmtnest repression_lag2 nafrme, nolog robust

*** Control for % Muslim Population ***
ologit physintflip Oil polity2 gdpenl jobinsecurity_bdm lpop diss_lag cowwarl lmtnest physint_lag muslim, cluster(ccode)
ologit physintflip oil_gas_rentPOP polity2 gdpenl jobinsecurity_bdm lpop diss_lag cowwarl lmtnest physint_lag muslim, cluster(ccode)
ologit pts_a Oil polity2 gdpenl jobinsecurity_bdm lpop diss_lag cowwarl lmtnest repression_lag muslim, cluster(ccode)
ologit pts_a oil_gas_rentPOP polity2 gdpenl jobinsecurity_bdm lpop diss_lag cowwarl lmtnest repression_lag muslim, cluster(ccode)
ologit pts_s Oil polity2 gdpenl jobinsecurity_bdm lpop diss_lag cowwarl lmtnest repression_lag2 muslim, cluster(ccode)
ologit pts_s oil_gas_rentPOP polity2 gdpenl jobinsecurity_bdm lpop diss_lag cowwarl lmtnest repression_lag2 muslim, cluster(ccode)

*** Control for non-violent (as well as violent) dissent ***
ologit physintflip Oil polity2 gdpenl jobinsecurity_bdm lpop diss_lag nonvioldiss_lag cowwarl lmtnest physint_lag, nolog cluster(ccode)
ologit physintflip oil_gas_rentPOP polity2 gdpenl jobinsecurity_bdm lpop diss_lag nonvioldiss_lag cowwarl lmtnest physint_lag, nolog cluster(ccode)
ologit pts_a Oil polity2 gdpenl jobinsecurity_bdm lpop diss_lag nonvioldiss_lag cowwarl lmtnest repression_lag, nolog cluster(ccode)
ologit pts_a oil_gas_rentPOP polity2 gdpenl jobinsecurity_bdm lpop diss_lag nonvioldiss_lag cowwarl lmtnest repression_lag, nolog cluster(ccode)
ologit pts_s Oil polity2 gdpenl jobinsecurity_bdm lpop diss_lag nonvioldiss_lag cowwarl lmtnest repression_lag2, nolog cluster(ccode)
ologit pts_s oil_gas_rentPOP polity2 gdpenl jobinsecurity_bdm lpop diss_lag nonvioldiss_lag cowwarl lmtnest repression_lag2, nolog cluster(ccode)

*** Control for bilateral and multilateral foreign aid (each as a % of GDP) ***
ologit physintflip Oil smbilataidpergdp smmultiaidpergdp polity2 gdpenl jobinsecurity_bdm lpop diss_lag cowwarl lmtnest physint_lag, nolog cluster(ccode)
ologit physintflip oil_gas_rentPOP smbilataidpergdp smmultiaidpergdp polity2 gdpenl jobinsecurity_bdm lpop diss_lag cowwarl lmtnest physint_lag, nolog cluster(ccode)
ologit pts_a Oil smbilataidpergdp smmultiaidpergdp polity2 gdpenl jobinsecurity_bdm lpop diss_lag cowwarl lmtnest repression_lag, nolog cluster(ccode)
ologit pts_a oil_gas_rentPOP smbilataidpergdp smmultiaidpergdp polity2 gdpenl jobinsecurity_bdm lpop diss_lag cowwarl lmtnest repression_lag, nolog cluster(ccode)
ologit pts_s Oil smbilataidpergdp smmultiaidpergdp polity2 gdpenl jobinsecurity_bdm lpop diss_lag cowwarl lmtnest repression_lag2, nolog cluster(ccode)
ologit pts_s oil_gas_rentPOP smbilataidpergdp smmultiaidpergdp polity2 gdpenl jobinsecurity_bdm lpop diss_lag cowwarl lmtnest repression_lag2, nolog cluster(ccode)


*Full set of main models:
*ologit physintflip Oil polity2 gdpenl jobinsecurity_bdm lpop diss_lag cowwarl lmtnest physint_lag, nolog cluster(ccode)
*ologit physintflip oil_gas_rentPOP polity2 gdpenl jobinsecurity_bdm lpop diss_lag cowwarl lmtnest physint_lag, nolog cluster(ccode)
*ologit pts_a Oil polity2 gdpenl jobinsecurity_bdm lpop diss_lag cowwarl lmtnest repression_lag, nolog cluster(ccode)
*ologit pts_a oil_gas_rentPOP polity2 gdpenl jobinsecurity_bdm lpop diss_lag cowwarl lmtnest repression_lag, nolog cluster(ccode)
*ologit pts_s Oil polity2 gdpenl jobinsecurity_bdm lpop diss_lag cowwarl lmtnest repression_lag2, nolog cluster(ccode)
*ologit pts_s oil_gas_rentPOP polity2 gdpenl jobinsecurity_bdm lpop diss_lag cowwarl lmtnest repression_lag2, nolog cluster(ccode)



log close
